{include file="public/_meta" /}
<title></title>
</head>

<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;
</span>财务管理 <span class="c-gray en">&gt;</span>
    交易明细 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" onclick="excel()" title="导出Excel文档">
        <i class="Hui-iconfont">&#xe681;</i></ a><a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="text-c">
        <form class="Huiform" method="get" action="">
            </span>

            <input type="text" class="input-text" style="width:150px" placeholder="会员ID" id="" name="keywords"
                   value="{$Request.get.keywords|default=''}">
            日期范围：
            <input type="text" class="input-text Wdate" name="start" id="countTimestart" onfocus="selecttime(1)"
                   value="{$Request.get.start|default=''}" size="17" class="date" readonly style="width:140px;">
            -
            <input type="text" class="input-text Wdate" name="end" id="countTimeend" onfocus="selecttime(2)"
                   value="{$Request.get.end|default=''}" size="17" class="date" readonly style="width:140px;">
            <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索
            </button>
        </form>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">购买商品金额：<strong>{$money}</strong> 元</span>
        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span></div>
    <div class="mt-20">
        <table class="table table-border  table-hover table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th>购买者信息</th>
                <th>支付方式</th>
                <th>原可交易金额</th>
                <th>交易金额</th>
                <th>剩余交易金额</th>
                <th>订单号</th>
                <th>消费时间</th>
            </tr>
            </thead>
            <tbody>
            {volist name='list' id="vo"}
            <tr class="text-c">
                <td>{$vo.us_id}<br>{$vo.us_nickname}</td>
                <td>
                    {if $vo.pay_type == 1 }钱包
                    {elseif $vo.pay_type == 2}微信
                    {elseif $vo.pay_type == 3}支付宝
                    {else /}
                    {/if}
                </td>
                <td>{$vo.y_pay_money}</td>
                <td>{$vo.money}</td>
                <td>{$vo.over_pay_money}</td>
                <td>{$vo.or_num}</td>
                <td>{$vo.add_time}</td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="pages" style="margin:20px;float: right; ">{$list|raw}</div>
    </div>
</div>
</body>
{include file="public/_footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript">
    $('select[name="wa_type"]').val({$Request.get.wa_type});

    function cancelbi(id) {
        layer.confirm('确定要取消该奖励吗？', {
            btn: ['确定', '取消']
        }, function (index, layero) {
            $.ajax({
                type: "post",
                url: "{:url('cancelbi')}",
                data: {id: id},
                success: function (data) {
                    layer.msg(data.msg);
                    if (data.code) {
                        setTimeout("window.location='';", 1000);
                        //location.href = '';
                    }
                }
            });
        });
    }


    function excel(){

        var keywords = $('input[name="keywords"]').val();
        var  start = $('input[name="start"]').val();
        var time_start = Date.parse(start)
        var end = $('input[name="end"]').val();
        var time_send= Date.parse(end)
        var url = "{:url('excel')}?&keywords="+keywords+"&time_start="+time_start+"&time_send="+time_send;
        creatIframe(url,'表格导出');
        location.href = '';

        // var url = "{:url('excel')}";
        // creatIframe(url,'表格导出');
        // location.href = '';
    }





    function selecttime(flag) {
        if (flag == 1) {
            var endTime = $("#countTimeend").val();
            if (endTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm', maxDate: endTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm'})
            }
        } else {
            var startTime = $("#countTimestart").val();
            if (startTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm', minDate: startTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm'})
            }
        }
    }
</script>


</html>